package com.xcc.app3.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

import com.xcc.app3.R;
import com.xcc.app3.di.component.DaggerActivityComponent;
import com.xcc.app3.di.module.ActivityModule;
import com.xcc.app3.presenter.TwoPresenter;

import javax.inject.Inject;

public class TwoActivity extends AppCompatActivity {
    @Inject
    public TwoPresenter twoPresenter;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        DaggerActivityComponent.builder()
                .activityModule(new ActivityModule(this))
                .build()
                .inject(this);

        findViewById(R.id.button).setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                updateUI();
            }
        });
    }


    public void updateUI() {
        if (twoPresenter != null)
            Toast.makeText(this, "two", Toast.LENGTH_LONG).show();
    }
}
